<template>
  <div class="bid-info">
      <h3>
        评标截止日期：{{infoData.evaluationEtime}}
        <el-button size="mini" @click="$router.push({'name':'bidEvaluation'})">返回</el-button>
      </h3>      
      <div class="info-div">
          <div class="info-title">
              <span>商务评分</span>
          </div>
        <el-table :data="busEvaluationData" border>
            <el-table-column label="操作" align="center" prop="purOrgName">
                <template slot-scope="scope" v-if="scope.row.evaluationStatus===0">
                    <el-button type="text" @click="tenderBtn(scope.row.psVendorId)">评分</el-button>
                </template>
            </el-table-column>
            <el-table-column label="供应商编码" align="center" prop="vendorCode"></el-table-column>
            <el-table-column label="供应商名称" align="center" prop="vendorName"></el-table-column>
            <el-table-column label="评分" align="center" prop="busScore"></el-table-column>
            <!-- <el-table-column label="描述" align="center" prop="materialName"></el-table-column> -->
            <el-table-column label="首次含税总价" align="center" prop="vendorAddress"></el-table-column>
            <el-table-column label="最终含税总价" align="center" prop="vendorAddress"></el-table-column>
            <el-table-column label="商务投标方案" align="center" prop="businessFileName">
                <template slot-scope="scope">
                    <a href="javascript:;" @click="downloadFile(scope.row.businessFileName,scope.row.businessFilePaht)" class="download_color">{{scope.row.businessFileName}}</a>
                </template>
            </el-table-column>
            <el-table-column label="资质文件" align="center" prop="aptitudeFileName">
                <template slot-scope="scope">
                    <a href="javascript:;" @click="downloadFile(scope.row.aptitudeFileName,scope.row.aptitudeFilePath)" class="download_color">{{scope.row.aptitudeFileName}}</a>
                </template>
            </el-table-column>
        </el-table>
      </div>
      <div class="info-div">
          <div class="info-title">
              <span>报价明细表</span>
          </div>
        <el-table :data="vendorMaterial" border>
            <!-- <el-table-column label="供货区域" align="center" prop="vendorAddress"></el-table-column> -->
            <el-table-column label="物料编码" align="center" prop="materialCode"></el-table-column>
            <el-table-column label="物料编码" align="center" prop="materialName"></el-table-column>
            <el-table-column label="单位" align="center" prop="materialUnit"></el-table-column>
            <el-table-column label="数量" align="center" prop="planQty"></el-table-column>
            <el-table-column label="供应商编码" align="center" prop="vendorCode"></el-table-column>
            <el-table-column label="供应商名称" align="center" prop="vendorNAME"></el-table-column>
            <el-table-column label="含税单价" align="center" prop="lastTaxPrice"></el-table-column>
            <el-table-column label="含税总价" align="center" prop="baseTotalPrice"></el-table-column>
            <el-table-column label="税率" align="center" prop="taxRate">
                    <template slot-scope="scope">
                        {{scope.row.taxRate!=null?scope.row.taxRate*100 +'%':''}} 
                    </template>
            </el-table-column>
            <el-table-column label="质保期" align="center" prop="qualityTime"></el-table-column>
            <el-table-column label="交货期" align="center" prop="deliveryDate"></el-table-column>
            <el-table-column label="备注" align="center" prop="remarks"></el-table-column>
        </el-table>
      </div>
  </div>
</template>
<script>
  export default {
    data() {
      return {
          infoData:{},
          busEvaluationData:[],
          vendorMaterial:[]
      };
    },
    created(){
        //获取商务评分信息
        this.axios.post(`${this.lib.config.host.bidtender}/bidmgt/view/getAllQuote/${this.$route.query.id}`).then((res) => {
            if(res.data){
                this.busEvaluationData = res.data;
            }
        }).catch(function (error) {
            console.log(error);
        });
        //获取报价明细表
        this.axios.post(`${this.lib.config.host.bidtender}/bidmgt/view/loadQuoteDetail2/${this.$route.query.id}`).then((res) => {
            if(res.data){
                this.vendorMaterial= res.data
            }
        }).catch(function (error) {
            console.log(error);
        });
    },
    methods: {
        tenderBtn(id){
            this.$router.push({
                'name':'EvaluationForm',
                query:{
                    'step':2,
                    'id':this.$route.query.id,isedit:0,
                    'psVendorId':id,
                    }
                })
        },
        // 下载附件
        download(filePath, fileName) {
            this.downloadFile(filePath, fileName);
        }
    }
  }

</script>

<style scoped>
h3{
    color:#DA1F24;
    overflow: hidden;
}
h3 button{
    float: right;
    margin-left: 20px;
}
.bid-info{
    border:1px solid #dadada;
    margin: 20px;
}
.bid-info .info-div{
    padding: 20px;
    border-bottom: 1px solid #dadada;
    overflow: hidden;
}
.bid-info .info-div:last-child{
    border:0;
}
.bid-info .info-text{
    float: left;
    width: 25%;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}
.bid-info .info-text.w100{
    width: 100%;
}
.bid-info .info-text.w50{
    width: 50%;
}
.bid-info .info-text span{
    float: left;
}
.bid-info .info-text .text-label{
    width: 110px;
    line-height: 20px;
}
.bid-info .info-text.w100 .text-label{
    position: absolute;
}
.bid-info .info-text .text-value{
    width: 100%;    
    margin-left: -110px;
    padding-left: 110px;
}
.bid-info .info-text.w100 .text-value{
    margin-left: 0;
}
.bid-info .info-title{
    font-size: 16px;
    margin-bottom: 20px;
}
.info-title span{
    display: inline-block;
    border-bottom:2px solid #DA1F24;
    height:40px;
    min-width: 110px;
    line-height:30px;
}
</style>
